package com.example.demo.admin.common.enums;

import com.example.demo.redis.able.LockInterface;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.concurrent.TimeUnit;

@Getter
@AllArgsConstructor
public enum LockEnum implements LockInterface {

    INTEGRAL_FREEZE_LOCK("integral_freeze:", "积分冻结锁", 2L, TimeUnit.SECONDS, 0L),
    INTEGRAL_UNFREEZE_LOCK("integral_unfreeze:", "积分解冻锁", 1L, TimeUnit.SECONDS, 0L),
    INTEGRAL_DEDUCTION_LOCK("integral_deduction:", "积分抵扣锁", 3L, TimeUnit.SECONDS, 0L),
    INTEGRAL_CHANGE_LOCK("integral_change:", "积分变更锁", 4L, TimeUnit.SECONDS, 0L),
    //
    ;

    private String key;
    private String desc;
    private Long expire;
    private TimeUnit unit;
    private Long waitTime;

    @Override
    public String getNamespace() {
        return "IntegralConstants.NAMESPACE";
    }
}
